import request from '@/http/http'

// export const ApiGetEcharts = (): RSP<IEchartsModel> => request.get(`http://kumanxuan1.f3322.net:8360/admin/stat`)

// 32.6添加商品的step1，商品分类的下拉选框， 商品分类管理 --- /productCategory/list/withChildren，查询所有一级分类及子分类，去到 stepsChild.vue 文件夹
export const ApiGetProductCategoryWithcChikdren = ():RSP<any> => request.get(`/productCategory/list/withChildren`)

// 32.11添加商品的step1,商品品牌的下拉选框，商品品牌管理 --- /brand/listAll，获取全部品牌列表,去到 stepsChild.vue 文件夹
export const ApiGetBrandCategory = (): RSP<any> => request.get(`/brand/listAll`)

// 商品属性分类管理 --- /productAttribute/category/list,分页获取所有商品属性分类
export const ApiProductAttributeCategory = (): RSP<any> => request.get(`/productAttribute/category/list`)

// 商品属性管理 --- /productAttribute/list/{cid},根据分类查询属性列表或参数列表
export const ApiCurrentProduceAttribute = (params: any): RSP<any> => request.get(`/productAttribute/list/${params.cid}?pageNum=1&pageSize=100&type=${params.type}`)

// 商品专题管理 --- /subject/listAll，获取全部商品专题
export const ApiGetSubjectList = (): RSP<any> => request.get(`/subject/listAll`)

// 商品优选管理 --- /prefrenceArea/listAll,获取所有商品优选
export const ApiPrefrenceAreaList = (): RSP<any> => request.get(`/prefrenceArea/listAll`)

// 商品管理 --- /product/create，创建商品
// export const ApiCreateProduct = (productParams: AddProduceForm): RSP<any> => request.post(`/product/create`, productParams)
export const ApiCreateProduct = (productParams: any): RSP<any> => request.post(`/product/create`, productParams)

// 商品管理 --- /product/list,查询商品
export const ApiProductList = (params: any): RSP<any> => request.get(`/product/list`, { params })
// export const ApiProductList = (params: any): RSP<any> => request.get(`/product/list?pageNum=${params.pageNum}&pageSize=${params.pageSize}`);

// 商品管理 /product/update/publishStatus，批量上下架
export const ApiProductUpdatePublishStatus = (params: any): RSP<any> => request.post(`/product/update/publishStatus?ids=${params.ids}&publishStatus=${params.publishStatus}`)

// 商品管理  /product/update/newStatus，批量设为新品
export const ApiProductUpdateNewStatus = (params: any): RSP<any> => request.post(`/product/update/newStatus?ids=${params.ids}&newStatus=${params.newStatus}`)

// 商品管理  /product/update/recommendStatus,批量推荐商品
export const ApiProductUpdateRecommendStatus = (params: any): RSP<any> => request.post(`/product/update/recommendStatus?ids=${params.ids}&recommendStatus=${params.recommendStatus}`)

// sku商品库存管理 --- /sku/{pid}，根据商品编号及sku编码模糊搜索sku库存,cid是必填，keyword是选填
export const ApiCurrentSku = (params: { pid: string | number, keyword?: string }): RSP<any> => request.get(`/sku/${params.pid}`, { params: { keyword: params.keyword } })

// 商品管理 --- /product/update/deleteStatus，批量修改删除状态
export const ApiProductDeleteStatus = (params: any): RSP<any> => request.post(`product/update/deleteStatus?ids=${params.ids}&deleteStatus=${params.deleteStatus}`)